﻿using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.Streaming;
using NPOI.XSSF.UserModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace slwhTools.ExcelHelper
{
    public class SExcel : ISExcel
    {
        /// <summary>
        /// 初始化工作簿
        /// </summary>
        /// <returns></returns>
        public IWorkbook SExcelInit()
        {
            if (ISExcel.type == WorkType.XLSX)
            {
                ISExcel.workbook = new XSSFWorkbook();
            }
            else if (ISExcel.type == WorkType.XLS)
            {
                ISExcel.workbook = new HSSFWorkbook();
            }
            else if (ISExcel.type == WorkType.SXLSX) { }
            {
                ISExcel.workbook = new SXSSFWorkbook(ISExcel.SXSSFRows);
            }

            return ISExcel.workbook;
        }
    }
}
